Open
Conversation
f056e4e to
e662f24
Compare
e662f24 to
9dc1c5f
Compare
houqp
reviewed
Jun 18, 2025
| "pyarrow==17.0.0", | ||
| "ipython==8.5.0", | ||
| "typing_extensions==4.13.2", | ||
| "pypika>=0.48.0", |
Collaborator
There was a problem hiding this comment.
This is a huge dependency, sure we want to use it here? SQL injection is something we should check for when processing untrusted user content. I would expect internal code to be trusted code, after all, if the programmer is malicious, they can also submit code to by pass all these safety checks in the same PR.
Member
There was a problem hiding this comment.
Haven't reviewed this PR yet but previously the attack vector was type confusion.
If a value was passed in that wasn't of a type that's supported it would get stringified and could then be susceptible.
Collaborator
There was a problem hiding this comment.
okay, that's a better reason for doing more validation here, but can this be checked with type annotation instead?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Use a SQL query builder to construct datafusion queries so there is less chance of misuse through SQL injections.
This adds a new dependency on
PyPikawhich is used to construct the SQL queries. This is the only popular SQL builder I found that generates plain string SQL (instead of using parameterization).This changes the behavior of some filters. Namely, filtering an int column by string will no longer work, e.g.
(it would have worked in the previous version because
'123'is directly interpolated into the query string)